<h1>Gradient</h1>

<p>A Gradient defines a control point that is used to specify how a gradient 
colour is displayed. Two or more control points are used to define how the 
colour changes across the gradient square. Each control point specifies:</p>

<table>

<tr>
<th nowrap>Field Name</th>
<th>Type</th>
<th>Size</th>
<th>Description</th>
</tr>

<tr>
<td nowrap valign="top">ratio</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">8</td>
<td>The location of the control point across the gradient square.</td>
</tr>

<tr>
<td nowrap valign="top">color</td>
<td nowrap valign="top">Color</td>
<td nowrap valign="top" align="right">&nbsp;</td>
<td>The colour displayed at the control point.</td>
</tr>

</table>

<p>The location of the control point is defined by a ratio - a number between 0 
and 255 - that specifies the relative location in the square. For Linear 
Gradient Fills a ratio of zero is mapped to the left side of the gradient square 
and 255 is mapped to the right side of the square. For Radial Gradient Fills a 
ratio of zero is mapped to the centre of the gradient square and 255 is mapped 
to the edge of the largest circle that fits inside the gradient square. A ratio 
is used rather than specifying coordinates within the gradient square as the 
coordinate space is transformed to fit the shape that the gradient is being 
displayed in.</p>

<p>Note that the object used to create the shape definition determines whether 
the alpha channel is encoded in the gradient colours. Simply specifying the level 
of transparency in the Color is not sufficient.</p>

<h2>History</h2>

<p>Gradient represents the GradientRecord structure from the 
Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 1.</p>
